package com.company.service;

import com.company.dao.ContactDao;
import com.company.entity.Contacts;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class ContactsService {
    @Autowired
    private ContactDao contactDao;

    public Contacts query() {
        return contactDao.findAll().get(0);
    }

    public void update(Contacts contacts) {
        Contacts contacts1 = contactDao.findAll().get(0);
        contacts.setId(contacts1.getId());
        contactDao.save(contacts);
    }
}
